Zsh with IntelliJ IDEs

July 01 2018

Make Zsh, Oh-my-zsh, Powerlevel9k work in IntelliJ IDEs

Powerlevel9k in IntelliJ build-in terminal

There are many tutorials show how to config oh-my-zsh's theme Powerlevel9k and use iTerm2 to setup color/font theme, but none I've found could make them work with IntelliJ's build-in terminal. So I post the solution I figured out in case someone need.

After installed zsh, change shell path in Preferences/Terminal/

Screen Shot 2018-06-23 at 8.33.25 PM

After installed oh-my-zsh and Powerlevel9k, open .zshrc by

nano ~/.zshrc

Powerlevel9k setting

To customize with Powerlevel9k, Input the setting into the file .zshrc and save it. Below is a basic example, you could find a lot more pre-defined config from others here

But be aware

  1. POWERLEVEL9K_MODE must be before other theme setting, read this
  2. POWERLEVEL9K_MODE has 4 values for 4 different type of fonts, you need select the correct one for the font you wanna use read this. (If you couldn't decide, you can try one by one follow [1] until your terminal shows the right content)

[1]: Enter the mode string - save the .zshrc file. - in terminal, enter source ~/.zshrc to restart with the newest config.

POWERLEVEL9K_MODE="awesome-fontconfig"
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir vcs)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status ram load time)

Modify Intellij's config

You may notice that it works fine in iTerm2, and many articles start introducing how to modify the font/color theme in iTerm2. But it doesn't work for Intellij's terminal.

In WebStorm/Preferences/Editor/Color Scheme/Console Font/, change the font.

Screen Shot 2018-06-23 at 8.35.03 PM

If you couldn't find the font in dropdown, you need 1 make sure font installed 2 restart IDE completely.

Now the build-in terminal should display correct theme like this.

Screen Shot 2018-06-23 at 8.35.51 PM